# file header
snippet hdr
	/*******************************************************************************
	 * MODULE NAME         : ${1:system}
	 * TARGET ENVIRONMENT  : Any
	 * FILE NAME           : `expand('%:t')`
	 * FIRST CREATION DATE : `strftime("%Y/%m/%d")`
	 * ----------------------------------------------------------------------------
	 * @Author     : [`g:snips_author`]
	 * @E_mail     : [`g:snips_email`]
	 * @Version    : 1.0
	 * @fcopyright Copyright`strftime("%Y")` EExuke Inhand Networks.
	 ******************************************************************************/
	${2}
# function header
snippet funh
	/***************************************************************************************
	 * Function Name : ${1}
	 * Description   : ${2}
	 * @param [in ]  : ${3}
	 * @param [out]  : ${4:NULL}
	 * @return       : ${5:0}
	 ***************************************************************************************/
# include file
snippet Inc
	#include <${1:stdio}.h>
snippet inc
	#include "${1:`Filename("$1")`}.h"
# macro defines
snippet def
	#define ${1}    ${2}
snippet ifd
	#ifdef ${1:condition}
	#endif /* $1 */
snippet ifn
	#ifndef ${1:condition}
	#endif /* $1 */
snippet once
	#ifndef ${1:`toupper(Filename('', 'UNTITLED').'_H')`}
	#define $1

	${2}

	#endif /* $1 */
# condition
snippet if
	if (${1:/* condition */}) {
		${2:/* code */}
	}
snippet else
	else {
		${1:/* code */}
	}
# loop
snippet do
	do {
		${2:/* code */}
	} while (${1:/* condition */});
snippet while
	while (${1:/* condition */}) {
		${2:/* code */}
	}
snippet for
	for (${1:i}=0; $1<${2:/*Max*/}; $1${3:++}) {
		${4:/* code */}
	}
# main()
snippet main
	int main(int argc, const char *argv[])
	{
		${1}
		return 0;
	}
	${2}
#switch ()
snippet switch
	switch (${1:/*varable*/}) {
		case ${2:/*case 1*/}
			${3:/*do something*/}
			break;
		default:
			${4:/*do default*/}
	}
	${5}
#vfork()
snippet vfork
	pid = vfork();
	if (pid < 0) {
		perror("vfork error: ");
	} else if (pid == 0) {
		${1:/*child code*/}
		exit(0);
	} else {
		${2:/*parent code*/}
		exit(0);
	}
